/**
 * Created by 000188 on 2016/7/7.
 */
module.exports = {
    getUrlParam:     function ( name ) {
        var reg = new RegExp( "(^|&)" + name + "=([^&]*)(&|$)" ); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr( 1 ).match( reg ); //匹配目标参数
        if (r != null) return unescape( r[ 2 ] );
        return ''; //返回参数值
    },
    GA(){
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-40178411-1']);
        _gaq.push(['_setDomainName', 'ceair.com']);
        _gaq.push(['_setLocalGifPath', 'http://www.ceair.com/__utm.gif']);
        _gaq.push(['_setLocalRemoteServerMode']);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script');
            ga.type = 'text/javascript';
            ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(ga, s);
        })();


        var _fxcmd = _fxcmd || [];
        _fxcmd.sid = '043118173285ce9cda35a6e6ea65c64c';
        _fxcmd.trackAll = false;
        (function() {
            var _pzfx = document['createElement']('script');
            _pzfx.type = 'text/javascript';
            _pzfx.async = true;
            _pzfx.src = '//static.w3t.cn/fx/1/1/fx.js';
            var sc = document.getElementsByTagName('script')[0];
            sc.parentNode.insertBefore(_pzfx, sc);
        })();
    }
};